﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace sapphirelang.AST.Exprs
{
    // func(arg)
    class CallExpr : Expr
    {
        public string func;
        public Expr arg;

        public CallExpr(string func, Expr arg)
        {
            this.func = func;
            this.arg = arg;
        }
    }

    // obj.func(arg)
    // different from above because messages have a reciever
    // the syntax "obj.func" turns into "obj.func( {the 'none' value} )"
    class MessageExpr : Expr
    {
        public Expr obj;
        public string func;
        // arg is null if there never appeared a textual argument
        public Expr arg;

        public MessageExpr(Expr obj, string func, Expr arg)
        {
            this.obj = obj;
            this.func = func;
            this.arg = arg;
        }
        public MessageExpr(Expr obj, string func)
        {
            this.obj = obj;
            this.func = func;
            this.arg = null;
        }
    }
}
